home *** CD-ROM | disk | FTP | other *** search
/ The Trig Explorer / The Trig Explorer.iso / mac / Explorer / DEGREE.dxr / 00069.ls < prev    next >
Encoding:
Text File  |  1998-07-22  |  887 b   |  28 lines

  1. on enterFrame
  2.   set xCenter to ((the left of sprite 3 + the right of sprite 3) / 2) + 1
  3.   set yCenter to ((the top of sprite 3 + the bottom of sprite 3) / 2) + 1
  4.   set radius to (the width of sprite 3 / 2) - 2
  5.   puppetSprite(4, 1)
  6.   set the trails of sprite 4 to 1
  7.   repeat with n = 0 to 360
  8.     if the mouseDown then
  9.       exit repeat
  10.     end if
  11.     set dy to float(radius) * float(sin((360 - n) * PI / 180.0))
  12.     set dx to float(radius) * float(cos(n * PI / 180.0))
  13.     drawLine(4, yCenter, xCenter, yCenter + dy, xCenter + dx)
  14.     put n & " Degrees" into field "Degree"
  15.     updateStage()
  16.     startTimer()
  17.     if (n = 30) or (n = 60) or (n = 90) or (n = 180) or (n = 270) then
  18.       repeat while the timer < (4 * 60)
  19.         if the mouseDown then
  20.           exit repeat
  21.         end if
  22.       end repeat
  23.     end if
  24.   end repeat
  25.   puppetSprite(4, 0)
  26.   set the trails of sprite 4 to 0
  27. end
  28.